package com.cq.hd.member.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cq.hd.member.api.dto.AdminUserPointsDetailPageDto;
import com.cq.hd.member.api.dto.UserPointsDetailPageDto;
import com.cq.hd.member.api.vo.AdminUserPointsDetailPageVo;
import com.cq.hd.member.api.vo.UserPointsDetailPageVo;
import com.cq.hd.member.po.TbUserPointsDetailPo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface TbUserPointsDetailMapper extends BaseMapper<TbUserPointsDetailPo> {
    // 用户积分明细
    List<UserPointsDetailPageVo> listUserPointsDetailByDto(UserPointsDetailPageDto userPointsDetailPageDto);

    // 管理后台：用户积分明细
    List<AdminUserPointsDetailPageVo> listAdminUserPointsDetailByDto(AdminUserPointsDetailPageDto adminUserPointsDetailPageDto);

    // 获取用户订阅某个商家获得的积分，取消订阅的时候要扣回
    BigDecimal getUserSubscribePoints(@Param("businessId") Long businessId, @Param("userId") Long userId);

    TbUserPointsDetailPo getByOrderId(@Param("orderId") Long orderId, @Param("pointsType") Integer pointsType);
}
